package com.pojo;

import java.util.Arrays;

/**
 * Created by wcd on 2017/2/24.
 */
public class Test1 {
    public static  void main(String[] args){
//        Animal dog =new Dog();
//        dog.run();
//
//        Animal animal =  new Animal();
//        if(animal instanceof Dog){
//            Dog d =(Dog)animal;
//        }
        Animal[] animals =new Animal[5];
        for(int i=0;i<5;i++){
            animals[i]=new Animal(String.valueOf(i));
        }
        //boolean flag=animals.getClass()==Animal[].class;
        for(Animal animal:animals){
            System.out.println(animal);
        }
        animals=Arrays.copyOf(animals,6,Animal[].class);
        System.out.println("---------------------");
        for(Animal animal:animals){
            System.out.println(animal);
        }

    }

}
